jQuery(document).ready(function() {
	//创建JQGRID表格
	
	//var grid = 
	$("#table1").ligerGrid({
        columns: [
                  { display: 'id', name: 'id', hide:1, width:1 },
                  { display: '单据编号', name: 'no', width: 150 },
                  { display: '销售单号', name: 'soNo', width: 150},
                  { display: '客户编号', name: 'cliNo', width: 150},
                  { display: '客户单位名称', name: 'cliName', width: 200 },
                  { display: '单据状态', name: 'billstatus', width: 80,
                	  render: function (item){               		 
                		  var billStatus=item.billstatus;
                		 
                		  if(billStatus=="0"){
                			  return "草稿";
                		  }
                		  if(billStatus=="1"){
                			  return "待审核";//待二级审核
                		  }
                		  if(billStatus=="2"){
                			  return "已完结";//二审完结，出库
                		  }
                		  if(billStatus=="3"){
                			  return "已驳回";
                		  }
                		  if(billStatus=="4"){
                			  return "已取消";
                		  }
                	  }},
                	  { display: '冻结状态', name: 'frozenStatus', width: 80,
                    	  render: function (item){               		 
                    		  var frozenStatus=item.frozenStatus;
                    		 
                    		  if(frozenStatus=="0"){
                    			  return "未冻结";
                    		  }
                    		  if(frozenStatus=="1"){
                    			  return "全部冻结";
                    		  }
                    		  if(frozenStatus=="2"){
                    			  return "部分冻结";
                    		  }
                    		  if(frozenStatus=="3"){
                    			  return "部分解冻";
                    		  }
                    		  if(frozenStatus=="4"){
                    			  return "全部解冻";
                    		  }
                    	  }
                  },
                  { display: '制单人', name: 'listerName', width: 100 },
                  { display: 'dcruser', name: 'dcruser', width: 1,hide:true },
                  { display: '创建时间', name: 'dctime', width: 100,
                	  render: function (item){
                		  var cdate=new Date(item.dctime);
                		  return formatDate(cdate,"yyyy-MM-dd");
                	  }},
                  { display: '备注', name: 'remark', width: 120}
                  ],  
                      usePager: true,pageSize:15,pageSizeOptions :[10,15,20,30,40,50],
                      url : basic_Url+"/list.do",
                      width: "100%", height:"98%", checkbox: true,rownumbers:true,
                      enabledSort:false,//hxm    
                      onDblClickRow : function (data, rowindex, rowobj){
                    	  basic_Title='编辑';
                    	  edit(data);
                       }
                  });
	$("#pageloading").hide();
});

